import dayjs from "dayjs";

function getcolumns(setdrawer) {
  return {
    columns: [
      { title: "店铺名", dataIndex: "store_name", key: "store_name" },
      {
        title: "采购日期",
        dataIndex: "in_store_date",
        key: "in_store_date",
        valueType: "date",
        searchvalueType: "dateRange",
        render: (text, row) => {
          return dayjs(row?.in_store_date)?.format("YYYY-MM-DD");
        },
      },
      {
        title: "姓名",
        dataIndex: "user_name",
        key: "user_name",
        copyable:true,
        formItemProps: { rules: [{ required: true, message: "此项为必填项" }] },
      },
      {
        title: "电话",
        dataIndex: "telephone",
        key: "telephone",
        copyable:true,
        formItemProps: { rules: [{ required: true, message: "此项为必填项" }] },
      },
      {
        title: "地址",
        dataIndex: "address",
        key: "address",
        valueType: "textarea",
        copyable:true,
        colProps: { span: 24 },
      },
      { title: "型号", dataIndex: "model", key: "model" },
      { title: "发出单号", dataIndex: "out_no", key: "out_no" },
      {
        title: "退回原因",
        dataIndex: "back_cause",
        key: "back_cause",
        valueType: "textarea",
        colProps: { span: 24 },
      },
      { title: "退回单号", dataIndex: "back_no", key: "back_no" },
      {
        title: "数量",
        dataIndex: "num",
        key: "num",
        valueType: "digit",
        hideInSearch: true,
      },
      {
        title: "价格",
        dataIndex: "price",
        key: "price",
        valueType: "money",
        hideInSearch: true,
      },
      {
        title: "拒收费",
        dataIndex: "reject_price",
        key: "reject_price",
        valueType: "money",
        hideInSearch: true,
      },
      { title: "签收状态", dataIndex: "status", key: "status" },
      {
        title: "退货单日期",
        dataIndex: "back_date",
        key: "back_date",
        valueType: "date",
        searchvalueType: "dateRange",
        formItemProps: { rules: [{ required: true, message: "此项为必填项" }] },
        render: (text, row) => {
          return dayjs(row?.back_date)?.format("YYYY-MM-DD");
        },
      },
      {
        title: "备注",
        dataIndex: "remark",
        key: "remark",
        valueType: "textarea",
        colProps: { span: 24 },
      },
    ],
    pathconfig: {
      enableadd: true,
      enableedit: true,
      enabledelete: true,
      enabledetail: true,
      add: "/webtool/v1/purchase",
      edit: "/webtool/v1/purchase",
      list: "/webtool/v1/purchase",
      delete: "/webtool/v1/purchase",
      detail: "",
    },
  };
}
export default getcolumns;
